<?php
// @formatter:off
/**
 * @file dynamic.conf.themes.php
 * @author Alejandro Dario Simi
 * @date $Date: 2013-06-22 17:58:11 +0000 (Sat, 22 Jun 2013) $
 *
 * In this file you can find all the general assignments for themes values like
 * name and id of the corrent group, name and id of current directory (if any),
 * etc.
 *
 * This file is included from dynamic.conf.php only when it's running for a web
 * request and not for shell executions.
 *
 * $Id: dynamic.conf.themes.php 83 2013-06-22 17:58:11Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0.0.1/includes/dynamic.conf.themes.php $
 */

//
// Current group information
$wcThemeAssigns["GROUP-ID"]		= $wcGroup ? $wcGroup->id   : -1;
$wcThemeAssigns["GROUP-NAME"]		= $wcGroup ? $wcGroup->name : "Group Unknown";
//
// Current user information
if($wcUser) {
	$wcThemeAssigns["USER-ID"]		= $wcUser->id();
	//$wcThemeAssigns["USER-NAME"]		= $wcUser->name();
	$wcThemeAssigns["USER-USERNAME"]	= $wcUser->username();
	$wcThemeAssigns["USER-AVATAR"]		= $wcUser->avatar();
} else {
	$wcThemeAssigns["USER-AVATAR"]		= "{$wcDefaults["avatar-basic"]}/no-user.png";
}
//
// Current comic information
if($wcComic) {
	$wcThemeAssigns["COMIC-ID"]		= $wcComic->id;
	$wcThemeAssigns["COMIC-NAME"]		= $wcComic->name;
	if($wcComic->next_name) {
		$wcThemeAssigns["COMIC-NEXT-NAME"]	= $wcComic->next_name;
	}
}
//
// Current directory information
if($wcDirectory) {
	$wcThemeAssigns["DIRECTORY-ID"]		= $wcDirectory->id;
	$wcThemeAssigns["DIRECTORY-NAME"]	= $wcDirectory->name;
	$wcThemeAssigns["DIRECTORY-COUNT"]	= $wcDirectory->count;
	$wcThemeAssigns["DIRECTORY-DCOUNT"]	= $wcDirectory->dcount;
	if($wcDirectory->next_name) {
		$wcThemeAssigns["DIRECTORY-NEXT-NAME"]	= $wcDirectory->next_name;
	}
}
//
// Current tag information
if($wcTag) {
	$wcThemeAssigns["TAG-ID"]		= $wcTag->id;
	$wcThemeAssigns["TAG-NAME"]		= $wcTag->name;
	$wcThemeAssigns["TAG-COUNT"]		= $wcTag->count;
}
//
// Current collection information
if($wcCollection) {
	$wcThemeAssigns["COLLECTION-ID"]	= $wcCollection->id;
	$wcThemeAssigns["COLLECTION-NAME"]	= $wcCollection->name;
	$wcThemeAssigns["COLLECTION-COUNT"]	= $wcCollection->count;
	$wcThemeAssigns["COLLECTION-SUBCOUNT"]	= $wcCollection->subcount;
}
//
// Current rule information
if($wcRule) {
	$wcThemeAssigns["RULE-ID"]		= $wcRule->id;
	$wcThemeAssigns["RULE-NAME"]		= $wcRule->name;
	$wcThemeAssigns["RULE-COUNT"]		= $wcRule->count;
	if($wcRuleAction) {
		$wcThemeAssigns["RULE-ACTION-ID"]	= $wcRuleAction->id();
		$wcThemeAssigns["RULE-ACTION-NAME"]	= $wcRuleAction->name();
	}
}
//
// Setting all wcomix actions constants as assignments for all themes.
$constants = get_defined_constants(true);
foreach($constants["user"] as $name => $value) {
	if(preg_match("/^WC_((ACTION)|(SACTION)|(EACTION)|(RSS)|(SERVICE)|(COOKIE))_/", $name)) {
		$wcThemeAssigns[$name] = $value;
	}
}
//
// Setting general assignments.
// @{
$wcThemeAssigns["VERSION-NAME"]		= $wcVersions["name"];
$wcThemeAssigns["VERSION-VERSION"]	= $wcVersions["version"];
$wcThemeAssigns["VERSION-JQUERY"]	= $wcVersions["jquery"];
$wcThemeAssigns["VERSION-JQUERYUI"]	= $wcVersions["jqueryui"];
$wcThemeAssigns["SITE-NAME"]		= $wcSite["name"];
$wcThemeAssigns["SITE-EMAIL"]		= $wcSite["email"];
$wcThemeAssigns["SITE-URI"]		= $wcROOTURI;
if($wcSite["wiki"]) {
	$wcThemeAssigns["SITE-WIKI"]	= $wcSite["wiki"];
}
if($wcDefaults["read-only"]) {
	$wcThemeAssigns["READ-ONLY"]	= true;
}
// @}
?>